package implementation.client;

import java.util.Collection;

import implementation.shared.INotification;
import implementation.shared.stubs.IForumStub;
import implementation.shared.stubs.IPostStub;
import implementation.shared.stubs.IThreadStub;
import implementation.shared.stubs.IUserStub;

public interface IServerStub {
	
	
	
	/**
	 * 
	 * @return the error message returned by the server of the last unsuccessful operation
	 */
	public String getErrorMessage();
	/**
	 * 
	 * @param username password 
	 * @return if the login process was successful return true otherwise false 
	 */
	public boolean login(String username, String password);
	

	/**
	 * connects to the actual server at the specified host and port
	 * @param host the actual server host
	 * @param port the port
	 * @return true if connection was successful, false otherwise.
	 */
	public boolean connect(String host,int port);
	
	/**
	 *  
	 * @param username password 
	 * @return if the register process was successful return true otherwise false 
	 */
	public boolean register(String username, String password);
	
	/**
	 * 
	 * @param friendId
	 * @return if the adding friend process was successful return true otherwise false 
	 */
	public boolean addFriend(String friendName);
	
	public IPostStub getPost(int postID);
	
	public IThreadStub getThread(int threadID);
	
	public IForumStub getForum(int forumID);
	
	public Collection<IForumStub> getForums();
	
	public Collection<IThreadStub> getThreads(int forumID);
	
	public Collection<IPostStub> getPosts(int threadID);
	
	/**
	 * 
	 * @param  postID
	 * @param  topic 
	 * @param  content
	 * @return if the editing post process was successful return true otherwise false 
	 */
	public boolean editPost(int postID, String topic, String content);
	
	/**
	 * 
	 * @param topic
	 * @param content
	 * @return if the adding post process was successful return true otherwise false
	 */
	public boolean addPost(int threadId ,String topic, String content);
	
	public boolean addThread(int forumId ,String topic, String content);
	
	

	/*
	 * more methods to be added
	 */
	
	
	
	/*
	 * added by yuval-check if the team approves
	 */
	
	public Collection<IUserStub> getFriends();
	
	public boolean removeFriend(int FriendID);
	
	public boolean removeThread(int threadID);
	
	public boolean removePost(int postID); 
	
	public void close();
	
	//need to think...
	public boolean logout() ;
	
	public INotification getNotification();

}
